package com.api.core.util;

import com.alibaba.fastjson.JSON;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.io.PrintWriter;

public class WebUtil {

    public static void returnMsg(HttpServletResponse response, Object msg) {
        try {
            response.setContentType("text/html;charset=utf-8");
            PrintWriter out = response.getWriter();
            out.print(JSON.toJSON(msg));
            out.close();
        } catch (IOException e) {
            e.printStackTrace();
        }
    }


}
